import instacne from "../request";
import type {Ref} from 'vue'
// 我们需要的接口 /resource/list?pageNum=1&pageSize=10

export const ziYuanLieBiao = (params:{
    pageNum:number,
    pageSize:number
})=> instacne.get('/resource/list',{params})

// /role/listAll角色分配接口 /admin/updateStatus

export const KaiGuan =(params:{
    status:number|Ref<number>,
    id:any
}) => instacne.post(`admin/updateStatus/${params.id}?status=${params.status}`)

// mall-admin/menu/updateHidden/118 菜单列表开关
export const MenuKaiGuan =(params:{
    hidden:number|Ref<number>,
    id:any
}) => instacne.post(`menu/updateHidden/${params.id}?hidden=${params.hidden}`)

// mall-admin/role/updateStatus 角色列表开关
export const RoleKaiGuan =(params:{
    status:number|Ref<number>,
    id:any
}) => instacne.post(`role/updateStatus/${params.id}?status=${params.status}`)

export const JueSeFenPei = () => instacne.get('/role/listAll')


// 权限下的角色列表中的分配菜单  /mall-admin/menu/treeList
export const AllocMenu = () => instacne.get('/menu/treeList')


// 权限下的角色列表中的分配资源  
//mall-admin/resource/listAll
export const AllocResource = () => instacne.get('/resource/listAll')



// 权限下的菜单列表 /mall-admin/menu/list/0?pageNum=1&pageSize=10
export const OnMenu = () => instacne.get('/menu/list')